Computing devices often utilize a graphics processing unit (GPU) to accelerate the rendering of graphics data onto a display. Such computing devices may include, e.g., computer workstations, mobile phones, embedded systems, personal computers and video game consoles. GPUs are also used by windows-based operating systems to perform window composition operations. A windows-based operating system uses a graphical user interface (GUI) that includes a windowing system which allows a user to work with and switch between several different open application programs, each of which may run in its own application window. In such a system, the individual windows may be positioned and resized by a user into various overlapping and/or non-overlapping configurations.
A window manger is a type of software program that is used to control both the placement and appearance of the windows in a windows-based operating system. The window manager also interacts with the GPU to cause the windows to be drawn to the screen and to refresh the windows either periodically or in response to a change in position, size or appearance of any of the windows. Each application typically stores a representation of the current appearance of the application's window as a surface in the system memory. A surface may refer to a collection of color data for an array of pixels. In order to refresh the display, the window manager typically redraws all of the surfaces associated with all open application windows onto the screen. Because the entire set of surfaces to be displayed on a display at a given point in time may include surfaces that overlap with each other, the windows manager typically performs a surface composition operation, which converts the multiple independent surfaces into a single screen surface for presentation on a display. One technique for performing surface composition involves drawing the surfaces onto the screen in a back-to-front order, e.g., according to the painter's algorithm. In this way, if two surfaces contain overlapping portions, the overlapping portions of the front-most surface will be drawn on top of the overlapping portions of the back-most surface, thereby causing the overlapping portions of the first surface to be visible and the overlapping portions of the second surface to not be visible as a viewer would expect to see. Thus, a window manager may perform surface composition by drawing each application surface to the screen, whether visible or not, in a particular order.
To draw each application surface, the window manager may cause the GPU to render one or more primitives associated with the surface and to apply various combinations of textures to the primitives to give the desired appearance to the surfaces. The textures that are applied to each of the primitives may be defined by texture values that correspond to and/or are derived from the color values contained in the application surface associated with the primitive. In addition, the window manager may modify the texture values and/or apply additional textures to achieve particular visual effects, e.g., shadows, borders, transparency, dimming, etc. For each texture that is applied to a primitive, a GPU typically accesses the texture values for every pixel associated with the primitive from an off-chip memory, which may result in a high amount of memory bandwidth usage.